<?php

namespace App\Http\Controllers\Frontend\EdgeManage;

use App\Http\Controllers\Controller;
use App\Http\Repositories\EdgeManage\TypeRepo;
use App\Http\Requests\Validators\Backend\EdgeManage\TypeValidator;
use App\Traits\HelpFunctions;
use Illuminate\Http\Request;

/**
 * 类型相关处理
 */
class TypeController extends Controller
{
    use HelpFunctions;

    const VALIDATOR = TypeValidator::class;

    public function __construct()
    {
        $this->self_repo = new TypeRepo;
    }

    public function search(Request $request)
    {
        //参数验证
        $args = $request->only('pid', 'name', 'alias', 'type_level','paginate','page_num');
        $this->my_validate($args, 'searchRules');
        return $this->self_repo->search($args);
    }
}
